home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / PInterfaces / QD3DSet.p < prev    next >
Encoding:
Text File  |  1998-04-09  |  9.6 KB  |  269 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DSet.p
  3.  
  4.      Contains:    Q3Set types and routines                                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DSet;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DSET__}
  28. {$SETC __QD3DSET__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DSetIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37.  
  38.  
  39. {$PUSH}
  40. {$ALIGN POWER}
  41. {$LibExport+}
  42.  
  43. {*****************************************************************************
  44.  **                                                                             **
  45.  **                                Set Routines                                 **
  46.  **                                                                             **
  47.  ****************************************************************************}
  48. FUNCTION Q3Set_New: TQ3SetObject; C;
  49. FUNCTION Q3Set_GetType(theSet: TQ3SetObject): TQ3ObjectType; C;
  50. FUNCTION Q3Set_Add(theSet: TQ3SetObject; theType: TQ3ElementType; data: UNIV Ptr): TQ3Status; C;
  51. FUNCTION Q3Set_Get(theSet: TQ3SetObject; theType: TQ3ElementType; data: UNIV Ptr): TQ3Status; C;
  52. FUNCTION Q3Set_Contains(theSet: TQ3SetObject; theType: TQ3ElementType): TQ3Boolean; C;
  53. FUNCTION Q3Set_Clear(theSet: TQ3SetObject; theType: TQ3ElementType): TQ3Status; C;
  54. FUNCTION Q3Set_Empty(target: TQ3SetObject): TQ3Status; C;
  55. {
  56.  *  Iterating through all elements in a set
  57.  *
  58.  *  Pass in kQ3ElementTypeNone to get first type
  59.  *  kQ3ElementTypeNone is returned when end of list is reached
  60.  }
  61. FUNCTION Q3Set_GetNextElementType(theSet: TQ3SetObject; VAR theType: TQ3ElementType): TQ3Status; C;
  62.  
  63. {*****************************************************************************
  64.  **                                                                             **
  65.  **                                Attribute Types                                 **
  66.  **                                                                             **
  67.  ****************************************************************************}
  68.  *    For the data types listed below, pass in a pointer to it in the _Add 
  69.  *    and _Get calls.
  70.  *
  71.  *    For surface shader attributes, reference counts are incremented on 
  72.  *    the _Add and _Get 
  73.  }
  74.  
  75. TYPE
  76.     TQ3AttributeTypes             = LONGINT;
  77. CONST
  78.                                                                 {  Data Type                 }
  79.     kQ3AttributeTypeNone        = {TQ3AttributeTypes}0;            {  ---------                 }
  80.     kQ3AttributeTypeSurfaceUV    = {TQ3AttributeTypes}1;            {  TQ3Param2D                 }
  81.     kQ3AttributeTypeShadingUV    = {TQ3AttributeTypes}2;            {  TQ3Param2D                  }
  82.     kQ3AttributeTypeNormal        = {TQ3AttributeTypes}3;            {  TQ3Vector3D                  }
  83.     kQ3AttributeTypeAmbientCoefficient = {TQ3AttributeTypes}4;    {  float                      }
  84.     kQ3AttributeTypeDiffuseColor = {TQ3AttributeTypes}5;        {  TQ3ColorRGB                 }
  85.     kQ3AttributeTypeSpecularColor = {TQ3AttributeTypes}6;        {  TQ3ColorRGB                 }
  86.     kQ3AttributeTypeSpecularControl = {TQ3AttributeTypes}7;        {  float                     }
  87.     kQ3AttributeTypeTransparencyColor = {TQ3AttributeTypes}8;    {  TQ3ColorRGB                 }
  88.     kQ3AttributeTypeSurfaceTangent = {TQ3AttributeTypes}9;        {  TQ3Tangent2D               }
  89.     kQ3AttributeTypeHighlightState = {TQ3AttributeTypes}10;        {  TQ3Switch                  }
  90.     kQ3AttributeTypeSurfaceShader = {TQ3AttributeTypes}11;        {  TQ3SurfaceShaderObject     }
  91.     kQ3AttributeTypeNumTypes    = {TQ3AttributeTypes}12;
  92.  
  93.  
  94. TYPE
  95.     TQ3AttributeType                    = TQ3ElementType;
  96. {*****************************************************************************
  97.  **                                                                             **
  98.  **                                Attribute Drawing                             **
  99.  **                                                                             **
  100.  ****************************************************************************}
  101. FUNCTION Q3Attribute_Submit(attributeType: TQ3AttributeType; data: UNIV Ptr; view: TQ3ViewObject): TQ3Status; C;
  102.  
  103. {*****************************************************************************
  104.  **                                                                             **
  105.  **                            AttributeSet Routines                             **
  106.  **                                                                             **
  107.  ****************************************************************************}
  108. FUNCTION Q3AttributeSet_New: TQ3AttributeSet; C;
  109. FUNCTION Q3AttributeSet_Add(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType; data: UNIV Ptr): TQ3Status; C;
  110. FUNCTION Q3AttributeSet_Contains(attributeSet: TQ3AttributeSet; attributeType: TQ3AttributeType): TQ3Boolean; C;
  111. FUNCTION Q3AttributeSet_Get(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType; data: UNIV Ptr): TQ3Status; C;
  112. FUNCTION Q3AttributeSet_Clear(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType): TQ3Status; C;
  113. FUNCTION Q3AttributeSet_Empty(target: TQ3AttributeSet): TQ3Status; C;
  114. {
  115.  * Q3AttributeSet_GetNextAttributeType
  116.  *
  117.  * Pass in kQ3AttributeTypeNone to get first type
  118.  * kQ3AttributeTypeNone is returned when end of list is reached
  119.  }
  120. FUNCTION Q3AttributeSet_GetNextAttributeType(source: TQ3AttributeSet; VAR theType: TQ3AttributeType): TQ3Status; C;
  121. FUNCTION Q3AttributeSet_Submit(attributeSet: TQ3AttributeSet; view: TQ3ViewObject): TQ3Status; C;
  122. {
  123.  * Inherit from parent->child into result
  124.  *    Result attributes are:
  125.  *        all child attributes + all parent attributes NOT in the child
  126.  }
  127. FUNCTION Q3AttributeSet_Inherit(parent: TQ3AttributeSet; child: TQ3AttributeSet; result: TQ3AttributeSet): TQ3Status; C;
  128.  
  129. {*****************************************************************************
  130.  **                                                                             **
  131.  **                            Custom Element Registration                         **
  132.  **                                                                             **
  133.  ****************************************************************************}
  134. {
  135.  * Element Methods - 
  136.  *
  137.  *         When you create a custom element, you control what structures are 
  138.  *        passed around the API. For example, you may allow the Q3Set_Add call 
  139.  *        take one type of argument, store your element internally in some 
  140.  *        abstract data type, and have the Q3Set_Get call take a different 
  141.  *        argument.
  142.  *
  143.  *        For example:
  144.  *            
  145.  *        There are four calls which at some point will copy an element:
  146.  *
  147.  *        Q3Set_Add (copied from Application memory to QuickDraw3D memory)
  148.  *        Q3Set_Get (copied from QuickDraw3D memory to Application memory)
  149.  *        Q3Object_Duplicate (all elements are copied internally)
  150.  *        Q3AttributeSet_Inherit (all elements are copied internally)
  151.  *
  152.  *         Either CopyAdd or CopyReplace is called during the "_Add" call.
  153.  *            - CopyAdd is destructive and should assume "toElement" is garbage
  154.  *            - CopyReplace is replacing an existing element.
  155.  *
  156.  *         CopyGet is called during the "_Get" call.
  157.  *
  158.  *         CopyDuplicate is called to duplicate an element's internal structure.
  159.  *
  160.  * Attributes Methods - 
  161.  *
  162.  *        For copying data while Inheriting. Element methods are used
  163.  *        at all other times.
  164.  *    
  165.  *         CopyInherit is called to duplicate an element's internal structure 
  166.  *            during inheritance. You should make this as fast as possible.
  167.  *            (for example, if your custom element contains objects, you
  168.  *             should do a Q3Shared_GetReference instead of a Q3Object_Duplicate)
  169.  *            
  170.  *        The ElementDelete method will be called for all of your elements 
  171.  *        copied around via CopyAdd, CopyReplace, CopyDuplicate, and 
  172.  *        CopyInherit.
  173.  *        If CopyGet allocates any memory in it's destination, it is up to the 
  174.  *        application to delete it on its side.
  175.  }
  176.  
  177. CONST
  178.     kQ3XMethodTypeElementCopyAdd = 'ecpa';
  179.     kQ3XMethodTypeElementCopyReplace = 'ecpr';
  180.     kQ3XMethodTypeElementCopyGet = 'ecpg';
  181.     kQ3XMethodTypeElementCopyDuplicate = 'eccd';
  182.     kQ3XMethodTypeElementDelete    = 'ecpl';
  183.  
  184.  
  185. TYPE
  186. {$IFC TYPED_FUNCTION_POINTERS}
  187.     TQ3XElementCopyAddMethod = FUNCTION(fromAPIElement: UNIV Ptr; toInternalElement: UNIV Ptr): TQ3Status; C;
  188. {$ELSEC}
  189.     TQ3XElementCopyAddMethod = ProcPtr;
  190. {$ENDC}
  191.  
  192. {$IFC TYPED_FUNCTION_POINTERS}
  193.     TQ3XElementCopyReplaceMethod = FUNCTION(fromAPIElement: UNIV Ptr; ontoInternalElement: UNIV Ptr): TQ3Status; C;
  194. {$ELSEC}
  195.     TQ3XElementCopyReplaceMethod = ProcPtr;
  196. {$ENDC}
  197.  
  198. {$IFC TYPED_FUNCTION_POINTERS}
  199.     TQ3XElementCopyGetMethod = FUNCTION(fromInternalElement: UNIV Ptr; toAPIElement: UNIV Ptr): TQ3Status; C;
  200. {$ELSEC}
  201.     TQ3XElementCopyGetMethod = ProcPtr;
  202. {$ENDC}
  203.  
  204. {$IFC TYPED_FUNCTION_POINTERS}
  205.     TQ3XElementCopyDuplicateMethod = FUNCTION(fromInternalElement: UNIV Ptr; toInternalElement: UNIV Ptr): TQ3Status; C;
  206. {$ELSEC}
  207.     TQ3XElementCopyDuplicateMethod = ProcPtr;
  208. {$ENDC}
  209.  
  210. {$IFC TYPED_FUNCTION_POINTERS}
  211.     TQ3XElementDeleteMethod = FUNCTION(internalElement: UNIV Ptr): TQ3Status; C;
  212. {$ELSEC}
  213.     TQ3XElementDeleteMethod = ProcPtr;
  214. {$ENDC}
  215.  
  216. FUNCTION Q3XElementClass_Register(VAR elementType: TQ3ElementType; name: ConstCStringPtr; sizeOfElement: UInt32; metaHandler: TQ3XMetaHandler): TQ3XObjectClass; C;
  217. FUNCTION Q3XElementType_GetElementSize(elementType: TQ3ElementType; VAR sizeOfElement: UInt32): TQ3Status; C;
  218.  
  219. {*****************************************************************************
  220.  **                                                                             **
  221.  **                        Custom Attribute Registration                         **
  222.  **                                                                             **
  223.  ****************************************************************************}
  224.  
  225. TYPE
  226.     TQ3XAttributeInheritMethod            = TQ3Boolean;
  227. { return kQ3True or kQ3False in your metahandler }
  228. {$IFC TYPED_FUNCTION_POINTERS}
  229.     TQ3XAttributeCopyInheritMethod = FUNCTION(fromInternalAttribute: UNIV Ptr; toInternalAttribute: UNIV Ptr): TQ3Status; C;
  230. {$ELSEC}
  231.     TQ3XAttributeCopyInheritMethod = ProcPtr;
  232. {$ENDC}
  233.  
  234. FUNCTION Q3XAttributeClass_Register(VAR attributeType: TQ3AttributeType; creatorName: ConstCStringPtr; sizeOfElement: UInt32; metaHandler: TQ3XMetaHandler): TQ3XObjectClass; C;
  235. {
  236.  *    Version 1.5
  237.  }
  238.  
  239. TYPE
  240. {$IFC TYPED_FUNCTION_POINTERS}
  241.     TQ3XAttributeDefaultMethod = FUNCTION(internalElement: UNIV Ptr): TQ3Status; C;
  242. {$ELSEC}
  243.     TQ3XAttributeDefaultMethod = ProcPtr;
  244. {$ENDC}
  245.  
  246. {$IFC TYPED_FUNCTION_POINTERS}
  247.     TQ3XAttributeIsDefaultMethod = FUNCTION(internalElement: UNIV Ptr): TQ3Boolean; C;
  248. {$ELSEC}
  249.     TQ3XAttributeIsDefaultMethod = ProcPtr;
  250. {$ENDC}
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258. {$ALIGN RESET}
  259. {$POP}
  260.  
  261. {$SETC UsingIncludes := QD3DSetIncludes}
  262.  
  263. {$ENDC} {__QD3DSET__}
  264.  
  265. {$IFC NOT UsingIncludes}
  266.  END.
  267. {$ENDC}
  268.